package com.happy3w.ssp.schoolmatehome.component.wx;

import lombok.*;

import java.nio.charset.StandardCharsets;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserInfoResponse {
    private String unionid;
    private String openid;
    private String nickname;
    private String sex;
    private String province;
    private String language;
    private String city;
    private String country;
    private String headimgurl;
    private List<String> privilege;


    public UserInfoResponse regular() {
        if (nickname != null) {
            nickname = new String(nickname.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
        }
        return this;
    }
}
